import router, { resetRouter } from '@/router';
import { createStore } from 'vuex'
const store = createStore({
    state: {
        currentPathName: '',
    },
    mutations: {
        setPath(state, count) {
            state.currentPathName = localStorage.getItem('currentPathName')
            //console.log(state.currentPathName);
        },
        logout(){
            // 清空缓存
            localStorage.removeItem("user");
            localStorage.removeItem("menus");
            router.push("/login");

            // 重置路由
            resetRouter();
            
        }

    },
})
export default store
 
